* if you need to plot the figure 2 only, load MonteCarlo_N2000_I10000.dta first and then run below:

gen Reveal1 = (Arep0-Srep0)/Arep0

sum rmspH
gen rmspHplot = r(mean)
sum rmspBBB
gen rmspBBBplot = r(mean)
replace Reveal = round(Reveal, .01)
bysort Reveal: egen mnrmspS = mean(rmspS)

twoway (lpoly rmspS Reveal1, lcolor(black) degree(4)) (scatter mn* Reveal, mcolor(gray)), leg(off) ytitle("RMSE of Democracy") xtitle("Proportion of 0 Cases Revealed")